package com.ajax.serice;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/ajaxrequest2")
public class AjaxRequest2Servlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置相应的内容类型以及字符集
        response.setContentType("text/html;charset=UTF-8");
        //获取响音流
        PrintWriter out = response.getWriter();
        //响应
        //out.print("JSON  HTML");
      //  out.print("<font color='red'>用户名已存在！！！！1</font>");

        //获取 Ajax get 请求提交数据
        String username = request.getParameter("username");
        String usercode = request.getParameter("usercode");
        out.print("username="+username+"usercode="+usercode);



    }
}
